﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MaterialsList.ascx.cs" Inherits="Workflow.Alerts.Sublayouts.ProfileSettings.MaterialsList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<script type="text/javascript">
    function RowClick(sender, args) {
        currentRowIndex = args.get_gridDataItem().get_element().rowIndex;
        document.location = document.getElementById('<%=DetailsPath.ClientID%>').value + "?mId=" + args.getDataKeyValue("id");
    }

    function RowCreated(sender, args) {
     
    }
</script>
<h2 class="settingsTitle">Materialen</h2>
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" GridLines="None"
    CssClass="tag_mainList" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" skin="workflow">
     <ExportSettings HideStructureColumns="true" Excel-Format="ExcelML" ExportOnlyData="true"
            IgnorePaging="true" />
    <ClientSettings EnableRowHoverStyle="true">
        <ClientEvents OnRowClick="RowClick" OnRowCreated="RowCreated"/>
    </ClientSettings>
    <MasterTableView DataKeyNames="id" ClientDataKeyNames="id" ShowFooter="false">
    <Columns>
        <telerik:GridBoundColumn UniqueName="id" Visible="false" DataField="id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="name"  DataField="name" HeaderText="Materiaal">
        </telerik:GridBoundColumn>        
        <telerik:GridBoundColumn UniqueName="price" DataFormatString="{0:N2}" DataField="price" HeaderText="Prijs (&euro;)">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="constructorprice" DataFormatString="{0:N2}" DataField="constructorprice" HeaderText="Prijs extern (&euro;)">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="unit"  DataField="unitname" HeaderText="Eenheid">
        </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

<input type="hidden" runat="server" id="DetailsPath" />
<asp:Button ID="btnExcel" runat="server" CssClass="iconButton buttonExportExcel floatRight"
        Text="Export" OnClick="btnExcel_Click" />
<div class="footerButtonContainer">
<asp:Button ID="btnNew" runat="server" Text="Materiaal toevoegen" 
    onclick="btnNew_Click" CssClass="styledButton styledButton150" />
</div>